home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / apport / package-hooks / source_apport.py < prev    next >
Encoding:
Python Source  |  2009-04-06  |  584 b   |  20 lines

  1. '''Apport package hook for apport itself.
  2.  
  3. This adds /var/log/apport.log and the file listing in /var/crash to the report.
  4.  
  5. (c) 2007 Canonical Ltd.
  6. Author: Martin Pitt <martin.pitt@ubuntu.com>'''
  7.  
  8. APPORT_LOG = '/var/log/apport.log'
  9.  
  10. import os.path, subprocess
  11. from glob import glob
  12. import apport.hookutils
  13.  
  14. def add_info(report):
  15.     apport.hookutils.attach_file_if_exists(report, APPORT_LOG, 'ApportLog')
  16.     reports = glob('/var/crash/*')
  17.     if reports:
  18.         report['CrashReports'] = apport.hookutils.command_output(
  19.             ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)
  20.